package com.vn.toaa.karaoke.database;

import android.os.Parcel;
import android.os.Parcelable;

public class SongModel implements Comparable<SongModel>, Parcelable {

	private int mSongId;
	private int mLanguage;
	private int mVolume;
	private int mCollection;
	private String mTitle;
	private String mTitleSearch;
	private String mTitleAbbr;
	private String mLyric;
	private String mLyricSearch;
	private String mAuthor;
	private String mAuthorSearch;

	public SongModel() {
		super();
	}

	public int getSongId() {
		return mSongId;
	}

	public void setSongId(int songId) {
		this.mSongId = songId;
	}

	public int getLanguage() {
		return mLanguage;
	}

	public void setLanguage(int language) {
		this.mLanguage = language;
	}

	public int getVolume() {
		return mVolume;
	}

	public void setVolume(int volume) {
		this.mVolume = volume;
	}

	public String getTitle() {
		return mTitle;
	}

	public void setTitle(String title) {
		this.mTitle = title;
	}

	public String getTitleSearch() {
		return mTitleSearch;
	}

	public void setTitleSearch(String titleSearch) {
		this.mTitleSearch = titleSearch;
	}

	public String getTitleAbbr() {
		return mTitleAbbr;
	}

	public void setTitleAbbr(String titleAbbr) {
		this.mTitleAbbr = titleAbbr;
	}

	public String getLyric() {
		return mLyric;
	}

	public void setLyric(String lyric) {
		this.mLyric = lyric;
	}

	public String getLyricSearch() {
		return mLyricSearch;
	}

	public void setLyricSearch(String lyricSearch) {
		this.mLyricSearch = lyricSearch;
	}

	public String getAuthor() {
		return mAuthor;
	}

	public void setAuthor(String author) {
		this.mAuthor = author;
	}

	public String getAuthorSearch() {
		return mAuthorSearch;
	}

	public void setAuthorSearch(String authorSearch) {
		this.mAuthorSearch = authorSearch;
	}

	@Override
	public int compareTo(SongModel another) {
		return String.valueOf(mTitleAbbr.charAt(0)).compareToIgnoreCase(String.valueOf(another.getTitleAbbr().charAt(0)));
	}

	public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel out, int flags) {
        out.writeInt(mSongId);
        out.writeInt(mLanguage);
        out.writeInt(mVolume);
        out.writeInt(mCollection);
        out.writeString(mTitle);
        out.writeString(mTitleSearch);
        out.writeString(mTitleAbbr);
        out.writeString(mLyric);
        out.writeString(mLyricSearch);
        out.writeString(mAuthor);
        out.writeString(mAuthorSearch);
    }

    public static final Parcelable.Creator<SongModel> CREATOR
            = new Parcelable.Creator<SongModel>() {
        public SongModel createFromParcel(Parcel in) {
            return new SongModel(in);
        }

        public SongModel[] newArray(int size) {
            return new SongModel[size];
        }
    };
    
    private SongModel(Parcel in) {
    	mSongId = in.readInt();
    	mLanguage = in.readInt();
    	mVolume = in.readInt();
    	mCollection = in.readInt();
    	mTitle = in.readString();
    	mTitleSearch = in.readString();
    	mTitleAbbr = in.readString();
    	mLyric = in.readString();
    	mLyricSearch = in.readString();
    	mAuthor = in.readString();
    	mAuthorSearch = in.readString();
    }

	public int getCollection() {
		return mCollection;
	}

	public void setCollection(int collection) {
		this.mCollection = collection;
	}
}
